package com.wanmait.translate.dto.audit;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wanmait.translate.utils.AuditEnum;

import java.util.Date;

/*
 * @Author huweibin
 * @Description 出差审核的具体内容
 * @Date 21:11 2020/11/23
 **/
public class TravelAuditContent implements AuditContentInterface {
    //出差表的id
    private Integer id;
    //提交人
    private  String person;
    //提交时间
    private Date date;
    //状态id
    private Integer stateId;
    //状态名
    private String stateName;
    //操作路径
    private String url;
    //审核类别
    @JsonIgnore
    private AuditEnum typeEnum;
    //类型中文名
    private String typeName;
    //类型名
    private String type;
    //类型Id
    private Integer  typeId;

    public TravelAuditContent(){
        typeEnum= AuditEnum.TRAVELED_AUDIT;
        typeName = typeEnum.getTypeName();
        type = typeEnum.getName();
        typeId = typeEnum.ordinal();
    }
    //设置Id时同时设置路径
    public void setId(Integer id) {
        this.url=typeEnum.geturl(id);
        this.id = id;
    }
    //设置状态同时获取类名
    public void setStateId(Integer stateId) {
        this.stateName= AuditEnum.getStateName(typeEnum, stateId);
        this.stateId = stateId;
    }

    public Integer getStateId() {
        return stateId;
    }

    public String getPerson() {
        return person;
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getId() {
        return id;
    }

    public String getStateName() {
        return stateName;
    }

    public void setStateName(String stateName) {
        this.stateName = stateName;
    }


    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    @Override
    public String toString() {
        return "TravelAuditContent{" +
                "id=" + id +
                ", person='" + person + '\'' +
                ", date=" + date +
                ", stateId=" + stateId +
                ", stateName='" + stateName + '\'' +
                ", url='" + url + '\'' +
                ", typeName='" + typeName + '\'' +
                ", type='" + type + '\'' +
                ", typeId=" + typeId +
                '}';
    }
    @JsonIgnore
    @Override
    public Date getInputDate() {
        return this.date;
    }
}
